/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modele;


/**
 * @author Hadrien
 */

public class Jeune extends Order {
    override public var description = bind "{quantity} Ticket Jeune\nZone : {zone}";
    public var zone:String = "1 - 3" on replace {computePrice()};
    init {
        //Zone 7 = Zone 3 à 6
        price = if (zone=="1 - 3") 3.40 else if (zone=="1 - 5") 6.85 else if (zone=="1 - 6") 10.15 else if (zone=="3 - 6") 4.25 else 0;
        name = "Mobilis";
    }

    override public function deliver () : Void {
        for (i in [1..quantity]) {
            println("Print a {name} for zone {zone}");
        }
    }

    function computePrice() {
        price = if (zone=="1 - 3") 3.40 else if (zone=="1 - 5") 6.85 else if (zone=="1 - 6") 10.15 else if (zone=="3 - 6") 4.25 else 0;
    }

}
